import Router from 'koa-router';
import proxyService from '../../../common/proxyService';
import {
  getShareParamH5,
  getUserInfoH5,
  getBargainInfoH5,
  getRankStaisticH5,
  getBoostListH5,
  brragelistH5,
  saveFormStatisticH5,
  getBargainDetailH5,
  getH5BargainGoodsListH5,
  saveHelpBargainH5,
  getSubscribeUrlH5,
  updateSubscribeSceneH5,
  saveJoinBargainH5,
  getSharePicH5,
  saveBargainFormStatisticH5,
  getUserSubscribeResultH5,
  getOrderDetailH5,
} from '../../../api';

const router = new Router();

//帮砍一刀
router.post('/saveHelpBargainH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, saveHelpBargainH5);
  return (ctx.body = response);
});
//
router.post('/getSubscribeUrlH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getSubscribeUrlH5);
  return (ctx.body = response);
});
//
router.post('/updateSubscribeSceneH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, updateSubscribeSceneH5);
  return (ctx.body = response);
});
//
router.post('/getSharePicH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getSharePicH5);
  return (ctx.body = response);
});
router.post('/getUserSubscribeResultH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getUserSubscribeResultH5);
  return (ctx.body = response);
});
//
router.post('/saveJoinBargainH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, saveJoinBargainH5);
  return (ctx.body = response);
});
//
router.post('/saveBargainFormStatisticH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, saveBargainFormStatisticH5);
  return (ctx.body = response);
});

//
router.post('/getShareParamH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getShareParamH5);
  return (ctx.body = response);
});
//
router.post('/getH5BargainGoodsListH5', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getH5BargainGoodsListH5);
  return (ctx.body = response);
});
//
router.post('/getUserInfoH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getUserInfoH5);
  return (ctx.body = response);
});

//
router.post('/getBargainInfoH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getBargainInfoH5);
  return (ctx.body = response);
});

router.post('/getRankStaisticH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getRankStaisticH5);
  return (ctx.body = response);
});

//
router.get('/getBoostListH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getBoostListH5);
  return (ctx.body = response);
});

//
router.post('/brragelistH5', async ctx => {
  const response = await proxyService.postProxy(ctx, brragelistH5);
  return (ctx.body = response);
});

router.post('/saveFormStatisticH5', async ctx => {
  const response = await proxyService.postProxy(ctx, saveFormStatisticH5);
  return (ctx.body = response);
});

//
router.post('/getBargainDetailH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getBargainDetailH5);
  return (ctx.body = response);
});
router.post('/getOrderDetail', async ctx => {
  const response = await proxyService.postProxy(ctx, getOrderDetailH5);
  // console.log(ctx.requestParams)
  return (ctx.body = response);
});

export default router;
